package com.lyy.system.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lyy.system.entity.Department;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lyy
 * @since 2022-05-15
 */
public interface DepartmentService extends IService<Department> {

    /**
     * 查询并统计所在部门人数
     * @return
     */
    List<Department> findDeptAndCount();

    /**
     * 条件分页查询数据
     * @param page
     * @param wrapper
     * @return
     */
    IPage<Department> findDeptPage(Page<Department> page, QueryWrapper<Department> wrapper);

    /**
     * 添加部门
     * @param department
     */
    void addDept(Department department);

    /**
     * 更新部门
     * @param department
     */
    void updataDepat(Department department);

    /**
     * 删除部门
     * @param id
     */
    void deleteDeprById(Long id);
}
